import React, { createElement, Component } from 'react';
import { render } from 'react-dom';
// createElement('div', {}, [])
// render(react元素, 挂载点, callback)

// let oDiv = createElement('div', {}, ['我是一个Div'])

let oUl = React.createElement(
    'ul',
    null,
    React.createElement(
        'li',
        null,
        '1111'
    ),
    React.createElement(
        'li',
        null,
        '2222'
    ),
    React.createElement(
        'li',
        null,
        '3333444'
    ),
    React.createElement(
        'li',
        null,
        '55555555'
    ),
    React.createElement(
        'li',
        null,
        '66666666'
    ),
    React.createElement(
        'li',
        null,
        '7777777888888888888'
    )
);

// function App() {
//     return <div>
//         <h3>我是函数式组件</h3>
//     </div>
// }

class App extends Component {
    render() {
        return React.createElement(
            'div',
            null,
            '\u6211\u662F\u7C7B\u7EC4\u4EF6~~~'
        );
    }
}

// render(可以接收组件)
render(React.createElement(App, null), document.getElementById('root'), () => {
    console.log('渲染成功');
});
